﻿
Imports System.Data.OleDb

Public Class ArticlesByCategory
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
        Dim SqlString As String = "select * from tblCategories where ID = @f1"
        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)
        cmd.CommandType = CommandType.Text
        cmd.Parameters.AddWithValue("@f1", Request.Params("CID"))
        oleDbConn.Open()

        Dim dr As OleDbDataReader = cmd.ExecuteReader()

        If dr.HasRows Then
            dr.Read()
            If Not IsDBNull(dr("CategoryName")) Then lblSummary.Text = "Showing all Articles Posted Under '" & dr("CategoryName") & "'"

        End If

    End Sub

End Class